﻿<%@ Page Title="" Language="C#" MasterPageFile="~/MasterPages/Site.master" AutoEventWireup="true" CodeFile="WIN12_2E.aspx.cs" Inherits="IFRS_WIN12_2E" %>

<%@ Register Assembly="vsm.CustomControl" Namespace="vsm.CustomControl" TagPrefix="cc1" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="Server">
    <script src="../Content/js/jquery.maskedinput.min.js"></script>
    <script type="text/javascript">
        $(document).ready(function () {
            $('#txtLicenseCardNo').mask('9-9999-99999-99-9');
            if ($('#rbtCustpmerType_Individuals').is(':checked')) {
                $('#txtLicenseCardNo').attr('readonly', false);
                $('#txtPassportNo').attr('readonly', false);
                $('#txtLicenseNo').val("").attr('readonly', true);
                $('#txtIssueAmount').val("").attr('readonly', true);
                $('#rbtStockExChangeRegister').attr("disabled", "disabled");
                $('#rbtCustpmerType_Firms').attr('checked', false)
                $('#txtLicenseCardNo').css('background-color', '');
                $('#txtPassportNo').css('background-color', '');
                $('#txtLicenseNo').css('background-color', '#E0E0E0');
                $('#txtIssueAmount').css('background-color', '#E0E0E0');
                $('#txtLicenseCardNo').mask('9-9999-99999-99-9');
            }
            else if ($('#rbtCustpmerType_Firms').is(':checked')) {
                $('#txtLicenseNo').attr('readonly', false);
                $('#txtIssueAmount').attr('readonly', false);
                $('#rbtStockExChangeRegister').removeAttr("disabled");
                $('#txtLicenseCardNo').val("").attr('readonly', true);
                $('#txtPassportNo').val("").attr('readonly', true);
                $('#rbtCustpmerType_Individuals').attr('checked', false)
                $('#txtLicenseNo').css('background-color', '');
                $('#txtIssueAmount').css('background-color', '');
                $('#txtLicenseCardNo').css('background-color', '#E0E0E0');
                $('#txtPassportNo').css('background-color', '#E0E0E0');
                $('#txtLicenseCardNo').unmask();
            }
            $('#rbtCustpmerType_Individuals').click(function () {
                if ($(this).is(':checked')) {
                    $('#txtLicenseCardNo').attr('readonly', false);
                    $('#txtPassportNo').attr('readonly', false);
                    $('#txtLicenseNo').val("").attr('readonly', true);
                    $('#txtIssueAmount').val("").attr('readonly', true);
                    $('#rbtStockExChangeRegister').attr("disabled", "disabled");
                    $('#rbtCustpmerType_Firms').attr('checked', false)
                    $('#txtLicenseCardNo').css('background-color', '');
                    $('#txtPassportNo').css('background-color', '');
                    $('#txtLicenseNo').css('background-color', '#E0E0E0');
                    $('#txtIssueAmount').css('background-color', '#E0E0E0');
                    $('#txtLicenseCardNo').mask('9-9999-99999-99-9');
                }
            });
            $('#rbtCustpmerType_Firms').click(function () {
                if ($(this).is(':checked')) {
                    $('#txtLicenseNo').attr('readonly', false);
                    $('#txtIssueAmount').val("0.00").attr('readonly', false);
                    $('#rbtStockExChangeRegister').removeAttr("disabled");
                    $('#txtLicenseCardNo').val("").attr('readonly', true);
                    $('#txtPassportNo').val("").attr('readonly', true);
                    $('#rbtCustpmerType_Individuals').attr('checked', false)
                    $('#txtLicenseNo').css('background-color', '');
                    $('#txtIssueAmount').css('background-color', '');
                    $('#txtLicenseCardNo').css('background-color', '#E0E0E0');
                    $('#txtPassportNo').css('background-color', '#E0E0E0');
                    $('#txtLicenseCardNo').unmask();
                    $('#rbtStockExChangeRegister').find("input[value='1']").attr("checked", "checked");
                }
            });
        });
    </script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
    <div class="container-custom">
        <div class="table_master">
            <div class="table_detail">
                <div class="rowinfo">
                    <div class="collabel">
                        <asp:Label ID="lblCustomerCode" runat="server" Text="<%$Resources:ifrsField,CUSTOMER_CODE%>" />&nbsp;:&nbsp;
                    </div>
                    <div class="colinfo">
                        <asp:TextBox ID="txtCustomerCode" SkinID="TextBoxWithNoColor"
                            runat="server"></asp:TextBox>
                        <span class="red">*</span>
                        <asp:RequiredFieldValidator ID="reqCustomerCode" runat="server" ErrorMessage=""
                            ControlToValidate="txtCustomerCode" Display="Dynamic"></asp:RequiredFieldValidator>
                    </div>
                    <div class="collabel">
                    </div>
                    <div class="colinfo">
                    </div>
                </div>
                <div class="rowinfo">
                    <div class="collabel">
                        <asp:Label ID="lblCustomerType" runat="server" Text="<%$Resources:ifrsField,CUSTOMER_TYPE%>" ClientIDMode="Static" />&nbsp;:&nbsp;
                    </div>
                    <div class="colinfo">
                        <asp:RadioButton ID="rbtCustpmerType_Individuals" runat="server" Text="<%$Resources:ifrsField,CUSTOMER_TYPE_INDIVIDUALS%>" ClientIDMode="Static" Checked="True" />
                    </div>
                    <div class="collabel">
                        <asp:Label ID="lblLicenseCardNo" runat="server" Text="<%$Resources:ifrsField,LICENSE_CARDNO%>" />&nbsp;:&nbsp;
                    </div>
                    <div class="colinfo">
                        <asp:TextBox ID="txtLicenseCardNo" SkinID="TextBoxWithNoColor" runat="server" ClientIDMode="Static"></asp:TextBox>
                        <asp:CustomValidator ID="validIDCard" runat="server" ControlToValidate="txtLicenseCardNo"
                            ErrorMessage="<BR>เลขที่บัตรประชาชนไม่ถูกต้อง" SetFocusOnError="True" ValidateEmptyText="True" Display="Dynamic"
                            OnServerValidate="CheckIDCard" ValidationGroup="Master" ForeColor="red"></asp:CustomValidator>
                    </div>
                </div>
                <div class="rowinfo">
                    <div class="collabel">
                    </div>
                    <div class="colinfo">
                    </div>
                    <div class="collabel">
                        <asp:Label ID="lblPassportNo" runat="server" Text="<%$Resources:ifrsField,PASSPORT_NO%>" />&nbsp;:&nbsp;
                    </div>
                    <div class="colinfo">
                        <asp:TextBox ID="txtPassportNo" SkinID="TextBoxWithNoColor" runat="server" ClientIDMode="Static"></asp:TextBox>
                    </div>
                </div>
                <div class="rowinfo">
                    <div class="collabel">
                    </div>
                    <div class="colinfo">
                        <asp:RadioButton ID="rbtCustpmerType_Firms" runat="server" Text="<%$Resources:ifrsField,CUSTOMER_TYPE_FIRMS%>" ClientIDMode="Static" />
                    </div>
                    <div class="collabel">
                        <asp:Label ID="lblLicenseNo" runat="server" Text="<%$Resources:ifrsField,LICENSE_NO%>" />&nbsp;:&nbsp;
                    </div>
                    <div class="colinfo">
                        <asp:TextBox ID="txtLicenseNo" SkinID="TextBoxWithNoColor" runat="server" ClientIDMode="Static"></asp:TextBox>
                        <asp:CustomValidator ID="reqLicenseNo" runat="server" ControlToValidate="txtLicenseNo"
                            ErrorMessage="" SetFocusOnError="True" ValidateEmptyText="True" Display="Dynamic"
                            OnServerValidate="ValidateLicenseNoEmpty" ValidationGroup="Master" ForeColor="red"></asp:CustomValidator>
                    </div>
                </div>
                <div class="rowinfo">
                    <div class="collabel">
                    </div>
                    <div class="colinfo">
                    </div>
                    <div class="collabel">
                        <asp:Label ID="lblIssueAmount" runat="server" Text="<%$Resources:ifrsField,ISSUE_AMOUNT%>" />&nbsp;:&nbsp;
                    </div>
                    <div class="colinfo">
                        <cc1:TextboxNumber ID="txtIssueAmount" runat="server" SkinID="TextBoxWithNoColor"
                            MaxLength="10" DigitDecimal="2" TypeTextbox="Currency" DefaultZero="true" ClientIDMode="Static" />
                        <asp:CustomValidator ID="reqIssueAmount" runat="server" ControlToValidate="txtIssueAmount"
                            ErrorMessage="" SetFocusOnError="True" ValidateEmptyText="True" Display="Dynamic"
                            OnServerValidate="ValidateIssueAmountEmpty" ValidationGroup="Master" ForeColor="red"></asp:CustomValidator>
                    </div>
                </div>
                <div class="rowinfo">
                    <div class="collabel">
                    </div>
                    <div class="colinfo">
                    </div>
                    <div class="collabel">
                        <asp:Label ID="lblStockExChangeRegister" runat="server" Text="<%$Resources:ifrsField,STOCKEXCHANGE_REGISTER%>" />&nbsp;:&nbsp;
                    </div>
                    <div class="colinfo">
                        <asp:RadioButtonList ID="rbtStockExChangeRegister" runat="server" RepeatDirection="Vertical" ClientIDMode="Static">
                            <asp:ListItem Text="<%$Resources:ifrsField,STOCKEXCHANGE_REGISTER%>" Value="1"/>
                            <asp:ListItem Text="<%$Resources:ifrsField,STOCKEXCHANGE_REGISTER_NOT%>" Value="2" />
                        </asp:RadioButtonList>
                    </div>
                </div>
                <div class="rowinfo">
                    <div class="collabel">
                        <asp:Label ID="lblOccupationType" runat="server" Text="<%$Resources:ifrsField,OCCUPATION_TYPE%>" />&nbsp;:&nbsp;
                    </div>
                    <div class="colinfo">
                        <asp:RadioButtonList ID="rbtOccupationType" runat="server" RepeatDirection="Horizontal">
                            <asp:ListItem Text="<%$Resources:ifrsField,OCCUPATION_TYPE_FULLTIME%>" Value="1" Selected="True" />
                            <asp:ListItem Text="<%$Resources:ifrsField,OCCUPATION_TYPE_FREELANCE%>" Value="2" />
                        </asp:RadioButtonList>
                    </div>
                    <div class="collabel">
                    </div>
                    <div class="colinfo">
                    </div>
                </div>
                <div class="rowinfo">
                    <div class="collabel">
                        <asp:Label ID="lblResidentArea" runat="server" Text="<%$Resources:ifrsField,RESIDENTAREA%>" />&nbsp;:&nbsp;
                    </div>
                    <div class="colinfo">
                        <asp:RadioButtonList ID="rbtResidentArea" runat="server" RepeatDirection="Horizontal">
                            <asp:ListItem Text="<%$Resources:ifrsField,RESIDENTAREA_OUT%>" Value="2" Selected="True" />
                            <asp:ListItem Text="<%$Resources:ifrsField,RESIDENTAREA_IN%>" Value="1" />
                        </asp:RadioButtonList>
                    </div>
                    <div class="collabel">
                    </div>
                    <div class="colinfo">
                    </div>
                </div>
            </div>
            <div class="colbtn">
                <asp:Button ID="btnSAVE" SkinID="NormalButton" runat="server" Text="<%$Resources:ifrsButton,SAVE%>" OnClick="btnSAVE_Click" />&nbsp;
                <asp:Button ID="btnCANCEL" SkinID="NormalButton" runat="server" Text="<%$Resources:ifrsButton,CANCEL%>" OnClick="btnCANCEL_Click" />
            </div>
        </div>
    </div>
    <script src="../Content/js/Currency.js" type="text/javascript"></script>
    <script src="../Content/plugins/custom.js" type="text/javascript"></script>
</asp:Content>